package com.imooc.ecommerce.controller;

import com.imooc.ecommerce.service.commuication.AuthorityFeignClient;
import com.imooc.ecommerce.vo.JwtToken;
import com.imooc.ecommerce.vo.UsernameAndPassword;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: zhangshao
 * @Since: 2023/11/29 16:17
 */
@RestController
@RequestMapping("/communication")
public class CommunicationController {

	@Autowired
	private AuthorityFeignClient feignClient;


	@PostMapping("/token-by-feign")
	public JwtToken getTokenByFeign(@RequestBody UsernameAndPassword usernameAndPassword){
		return feignClient.getTokenByFeign(usernameAndPassword);
	}

}
